Capture browser session video as a named artifact - #2480
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
videoto the capture set forwordpress.browser-probeandwordpress.browser-actionsvideo.webmartifactWhy
Browser evidence could show a final screenshot but never the session that produced it. A recording makes an interaction reviewable — what changed, in what order, and what the user would have seen — which is the missing half of before/after UI evidence.
Implementation notes
Two details drove the shape of this change.
Recording is a context-level capability, so
wordpress.browser-actionsnow takes the environment-context path when video is requested rather than a bare page.Playwright finalizes a recording only when the context closes, and names the file itself.
video.saveAs()is not usable here because it needs a live browser connection, and cleanup closes the context and the browser together — it fails withTarget page, context or browser has been closed. The recording is therefore staged in its own directory and adopted afterwards through the existing artifact writer, so it inherits manifest entries, hashing, and provenance rather than being written as a loose file.A recording is only reported in the summary once it has actually been adopted, so a failed capture cannot claim an artifact that is absent.
Verification
tests/browser-actions-video-capture.browser.test.ts, wired asnpm run test:browser-video-capture:capture=videorun records a real navigation and click against a local fixture, and produces a non-emptyvideo.webmthat the summary reportsAlso run:
tsc -b --force packages/runtime-core packages/runtime-playground packages/cli— cleantests/browser-actions-navigation-capture.browser.test.ts— 5 passing, no regressionsThe first version of this change used
video.saveAs()and the test caught it failing, which is why the adoption path exists.AI assistance